var ec2_Registerlb = {
    ec2ui_session : null,
    retVal : null,
    
    
    launch : function() {
     
//        this.retVal.LoadBalancerName = document.getElementById("ec2ui.createlb.Name").value;
//	this.retVal.Protocol = document.getElementById("ec2ui.createlb.Protocol").value;
//        this.retVal.elbport = document.getElementById("ec2ui.createlb.elbport").value;
//	this.retVal.instanceport = document.getElementById("ec2ui.createlb.instanceport").value.trim();
        this.retVal.Instances = document.getElementById("ec2ui.createlb.Instancelist").value;
	// This will be an empty string if <any> is selected
        //var a = document.getElementById("ec2ui.createlb.availabilityzonelist").selectedItem.value;
        //this.retVal.zone = {
        //    "availabilityZone": document.getElementById("ec2ui.createlb.availabilityzonelist").selectedItem.value
        //};
	 this.retVal.ok = true;
        return true;
    },
    init : function() {
       
        this.ec2ui_session = window.arguments[1];
        this.retVal = window.arguments[2];
        // availability zones
        //var availZoneMenu = document.getElementById("ec2ui.createlb.availabilityzonelist");
        //availZoneMenu.appendItem("<any>", null);
        //var availZones = this.ec2ui_session.model.getAvailabilityZones();
        //for (var i in availZones) {
        //    availZoneMenu.appendItem(availZones[i].name, availZones[i].name);
        //}
        //availZoneMenu.selectedIndex = 0;
	
	var InstanceMenu = document.getElementById("ec2ui.createlb.Instancelist");
        InstanceMenu.appendItem("<any>", null);
        var Instanceid = this.ec2ui_session.model.getInstances();
        for (var i in Instanceid) {
            InstanceMenu.appendItem(Instanceid[i].id , Instanceid[i].id);
        }
        InstanceMenu.selectedIndex = 0;

        

       
    }
    
}